<template>
  <vc-viewer @ready="onViewerReady">
    <VcPrimitiveView :geo-json="geoJson">

    </VcPrimitiveView>
    <!-- 注记层 -->
    <vc-layer-imagery :sort-order="20">
      <vc-imagery-provider-tianditu
        map-style="cva_c"
        :token="tandituToken"
      ></vc-imagery-provider-tianditu>
    </vc-layer-imagery>
    <vc-layer-imagery :sort-order="10">
      <vc-imagery-provider-tianditu
        :map-style="mapStyle"
        :token="tandituToken"
        ref="provider"
      ></vc-imagery-provider-tianditu>
    </vc-layer-imagery>
  </vc-viewer>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import VcPrimitiveView from "@/components/Cesium/VcPrimitiveView.vue";
const tandituToken = ref("436ce7e50d27eede2f2929307e6b33c0");
const mapStyle = ref("img_c");
const geoJson = ref({})
const onViewerReady = () => {
    Cesium.Resource.fetchJson('https://zouyaoji.top/vue-cesium/SampleData/json/schools.geojson').then(res => {
        geoJson.value = res;
    })
};
</script>
